package com.taxi.controller;

import com.taxi.service.TokenService;
import com.taxi.response.TokenResponse;
import com.taxi.result.Result;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: aniu
 * @Date: 2023/9/22
 * @ClassName: TokenController
 * @Description: Write class functionality and purpose here.
 * @Version: 1.0
 */
@RestController
public class TokenController {

    @Autowired
    private TokenService tokenService;

    //刷新token
    @ApiOperation("刷新token")
    @PostMapping("/token-refresh")
    public Result refreshToken(@RequestBody TokenResponse tokenResponse){
        return tokenService.refreshToken(tokenResponse.getRefreshToken());
    }
}
